<?php

namespace App\Http\Service\User;

use App\Http\Service\Basic\BasicService;
use Config;

class UserService extends BasicService
{
    /**
     * @param $where
     * @return bool|mixed
     * 登录
     */
    public function login($where)
    {
//        dd(Config::get('custom.setting.BASE_API_PATH').Config::get('custom.api.login'), json_encode($where));
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH').Config::get('custom.api.login'), json_encode($where), 'post');
    }

    public function Logout($where)
    {
        $url = '';
        if(isset($where['token'])){
            $url ='&token='.$where['token'];
        }
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH').Config::get('custom.api.logout').$url);

    }

    public function TokenCheck($where)
    {
        $url = '';
        if(isset($where['token'])){
            $url = "&token={$where['token']}";
        }
//        dd(Config::get('custom.setting.BASE_API_PATH').Config::get('custom.api.TokenCheck').$url);
        return $this->curlLogic->callWebServer(Config::get('custom.setting.BASE_API_PATH').Config::get('custom.api.TokenCheck').$url);
    }

}